/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.dao.estagio;

import ejb.dao.AbstractFacade;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Gomes
 */
@Stateless(mappedName = "CursoFacadeEJB")
public class CursoFacade extends AbstractFacade<Curso> implements CursoFacadeLocal {

    @PersistenceContext(unitName = "Sigef-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    @Override
    public List<Curso> listarCursos() {

        List<Curso> cursos = null;
        cursos = executeQuery("FROM Curso", 0, null);
        return cursos;

    }

    public CursoFacade() {
        super(Curso.class);
    }
}
